home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / __MANDEL / MANDELBR / CMAXDWEL.C < prev    next >
Text File  |  1992-03-25  |  899b  |  45 lines

  1. /* CMaxDwellDirector.c */
  2.  
  3. #include "CMandelApp.h"
  4. #include <Commands.h>
  5. #include <CIntegerText.h>
  6. #include "CMaxDwellDirector.h"
  7. #include "CMandelDoc.h"
  8. #include <CWindow.h>
  9.  
  10. void CMaxDwellDirector::IMaxDwellDirector(short DLOGid,
  11.                                             CMandelDoc *aMandelDoc,
  12.                                             CDirectorOwner *aSupervisor)
  13. {
  14.     CIntegerText *aEditItem;
  15.     
  16.     IDLOGDirector(DLOGid, aSupervisor);
  17.     FailNIL(aMandelDoc);
  18.     
  19.     aEditItem = (CIntegerText *)itsWindow->FindViewByID(kMaxDwellEdit);
  20.     aEditItem->SetIntValue(aMandelDoc->GetMaxDwell());
  21.     
  22.     itsMandelDoc = aMandelDoc;
  23. }
  24.  
  25. void CMaxDwellDirector::DoCommand( long aCmd)
  26. {
  27.     CIntegerText *aEditItem;
  28.  
  29.     switch (aCmd)
  30.     {
  31.         case cmdOK:
  32.             if (Validate())
  33.             {
  34.                 aEditItem = (CIntegerText *)itsWindow->FindViewByID(kMaxDwellEdit);
  35.                 itsMandelDoc->SetMaxDwell(aEditItem->GetIntValue());
  36.             }
  37.             else
  38.                 break;
  39.             
  40.         default:
  41.             inherited::DoCommand( aCmd);
  42.             break;
  43.     }
  44.     
  45. }